﻿<UserControl x:Class="CBR.Views.BookView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             xmlns:Controls="clr-namespace:CBR.Components.Controls"
			 xmlns:Converters="clr-namespace:CBR.Components.Converters"
             d:DesignHeight="300" d:DesignWidth="300"
			 Background="{DynamicResource CbrDarkBackgroundBrush}"
			 Loaded="UserControl_Loaded">
	
    <Grid Name="PageViewerGrid">

		<Controls:PageControl x:Name="PageViewer"
						ImageSource="{Binding ImgSource}" Scale="{Binding Scale, Mode=TwoWay}" FitMode="{Binding FitMode, Mode=OneWay}"
						IsEditing="{Binding IsInEditMode}" FrameList="{Binding FrameList, Mode=TwoWay}"
						PreviewMouseMove="PageViewer_PreviewMouseMove"
						PreviewMouseLeftButtonDown="PageViewer_PreviewMouseLeftButtonDown"
						PreviewMouseLeftButtonUp="PageViewer_PreviewMouseLeftButtonUp"
						PreviewKeyDown="PageViewer_PreviewKeyDown"
						PreviewKeyUp="PageViewer_PreviewKeyUp" />
		
		<Controls:ZoomFlyer Scale="{Binding Scale, Mode=TwoWay}" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="20"
							Visibility="{Binding ShowZoomFlyer, Converter={x:Static Converters:BoolToVisibilityConverter.Instance}}"/>

		<Controls:MagnifyGlass x:Name="Magnifier" ClipToBounds="True" VisualToDisplay="{Binding ElementName=PageViewer}" 
                               Scale="{Binding MagnifierSize}" Zoom="{Binding MagnifierScale}" />
    </Grid>
</UserControl>